
import MyAxios from "../request.js";

/**
 * 获取字典列表
 * @param {Object} params 查询参数
 * @returns 
 */
export async function getPromptList(params) {
    return await MyAxios.post("/dict/list/page/vo", params)
}

/**
 * 获取字典分类
 * @returns 
 */
export async function getCategories() {
    return await MyAxios.get("/dict/categories")
}

/**
 * 添加字典
 * @param {Object} dictData 字典数据
 * @returns 
 */
export async function addDict(dictData) {
    return await MyAxios.post("/dict/add", dictData)
}

/**
 * 更新字典信息
 * @param {Object} dictData 字典数据
 * @returns 
 */
export async function updateDict(dictData) {
    return await MyAxios.post("/dict/update", dictData)
}

/**
 * 删除字典
 * @param {number} id 字典ID
 * @returns
 */
export async function deleteDict(id) {
    return await MyAxios.post("/dict/delete", { id })
}

/**
 * 获取模板统计数据
 * @returns
 */
export async function getDictStats() {
    return await MyAxios.get("/dict/stats")
}

/**
 * 获取热门模板
 * @param {number} limit 限制数量
 * @returns
 */
export async function getPopularDicts(limit = 10) {
    return await MyAxios.get(`/dict/popular?limit=${limit}`)
}
